package com.gz.thread.runnable;


//线程优先级 1-10  默认5
public class Priority {
    public static void main(String[] args) {
        MyPriority myPriority = new MyPriority();

        Thread t1 = new Thread(myPriority){{setPriority(1);}};
        t1.start();

        Thread t3 = new Thread(myPriority){{setPriority(3);}};
        t3.start();

        Thread t10 = new Thread(myPriority){{setPriority(10);}};
        t10.start();
    }
}


class MyPriority implements Runnable{

    public void run() {
        System.out.println(Thread.currentThread().getName()+"----->"+Thread.currentThread().getPriority());
    }
}
